package com.spring.provider.controller;

import java.util.HashMap;
import java.util.Map;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@RefreshScope
@RestController
@RequestMapping("/member")
public class MemberController {
	
	
	/*
	 * @Value("${profile}") private String profile;
	 * 
	 * @RequestMapping("/getConfig") public Object getConfig() { return profile; }
	 */
	
	
	
	@RequestMapping("/getMember")
	public Object getMember(@RequestParam("name") String name) {
		System.out.println("方法getMember 线程名称:"+Thread.currentThread().getName());
		
		Map<String,String> map = new HashMap<String,String>();
		map.put("teacherName", name);
		return map;
		
	}
	
	@RequestMapping("/getBody")
	public Object getBody(@RequestBody String body) {
		System.out.println("body="+body);
		Map<String,String> map = new HashMap<String,String>();
		map.put("teacherName", "bb");
		return map;
		
	}
	
	
	@RequestMapping("/getMemberInfo")
	public Object getMemberInfo() {
		System.out.println("方法getMemberInfo 线程名称:"+Thread.currentThread().getName());
		return "我是member服务";
		
	}

}
